import create from 'zustand'
let storage = window.localStorage

const useStore = create((set) => ({
  nowroute: "",
  setnowroute: (nowroute) => {
    storage.nowroute = JSON.stringify(nowroute)
    set(() => ({ nowroute: nowroute }))
  },
  collapsed: false,
  setcollapsed: (collapsed) => set(() => ({ collapsed: collapsed })),
  needrefreshsclist: false,
  setneedrefreshsclist: (needrefreshsclist) => set(() => ({ needrefreshsclist: needrefreshsclist })),
  anpz: null,
  setanpz: (anpz) => set(() => ({ anpz: anpz })),
}))

export default useStore;